package com.wyl.niupi.framework.util.informationTransfer;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @author 吴宇亮 on 2020/12/12 11:53
 */
public class _JsonUtil {

    /**
     * 格式化的将json打印到控制台上
     * @param json 将要打印的json
     */
    public static void beautyPrint(String json){
        try {
            ObjectMapper mapper = new ObjectMapper();
            Object obj = mapper.readValue(json, Object.class);
            System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj));
        } catch (Exception e){
            e.printStackTrace();
        }
    }
}
